/**
 * 
 */
package rs.fon.rapidminer.operator.learner.tree;

import java.util.Date;
import java.util.List;

import rs.fon.rapidminer.process.annotation.Parameter;
import com.rapidminer.example.ExampleSet;;
/**
 * @author Nikola
 * 
 */
public class SizeOfLeafStoppingCriteria extends AbstractStopingCriteria {
	@Parameter(defaultValue = "5", maxValue = "10000", minValue = "1")
	private Double Size_Of_Leaf;

	

	@Override
	public Object DoWork(ExampleSet exampleSet, int depth, Date startDate, List<rs.fon.rapidminer.process.Parameter> parameters)
	{
		boolean promenljiva = true;
		int size =  Integer.parseInt(parameters.get(0).getXenteredValue());
		if(depth>1)
		promenljiva = (exampleSet.size() < size );
		
		return promenljiva;
	}
}
